package src.data;

import java.util.Set;
import src.domain.MailBox;
import src.domain.OutgoingMessage;


public class OutgoingMessageSRV {
	
	private static OutgoingMessageDAO dao;
	static {
		dao = OutgoingMessageDAO.getInstance();
	}
	
	public static OutgoingMessage getByID(long idOutgoingMessage){
		OutgoingMessage outgoingMessage=new OutgoingMessage();
		outgoingMessage.setId(idOutgoingMessage);
		return dao.getByID(outgoingMessage);
	}
	
	public static void save(OutgoingMessage outgoingMessage) {

		dao.save(outgoingMessage);

	}
	
	public static Set<OutgoingMessage> getOutgoingMessages(long idMailBox){
		MailBox mailbox=new MailBox();
		mailbox.setId(idMailBox);
		return dao.getOutgoingMessages(mailbox);
	}
}